export function loadMapScript() {
  return new Promise<string>((resolve, reject) => {
    const script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = `https://map.qq.com/api/gljs?v=1.exp&key=${import.meta.env.VITE_MAP_KEY}`;

    document.body.appendChild(script);
    script.onload = () => {
      resolve('加载完成');
    };

    script.onerror = () => {
      reject('加载失败');
    };
  });
}
